package com.dlc.beijingrfid.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import java.util.List;

public class FragmentViewPagerAdapter extends FragmentStatePagerAdapter {
	private FragmentManager fm;
	private List<Fragment> fragmentList;
	private List<String>   titleList;

	public FragmentViewPagerAdapter(FragmentManager fm,  List<Fragment> fragmentList, List<String> titleList) {
		super(fm);
		this.fragmentList = fragmentList;
		this.titleList = titleList;
	}

@Override
public Fragment getItem(int position) {
	return fragmentList.get(position);
}

	@Override
	public int getCount() {
		return fragmentList.size();
	}
	//这个方法返回Tab显示的文字。这里通过在实例化TabFragment的时候，传入的title参数返回标题。
	@Override
	public CharSequence getPageTitle(int position) {
		return titleList.get(position);
	}

}
